<template>
    <div class="box">
        <div class="message">
            <div class="search">
                <input type="text">
            </div>
            <div class="list">
                <div class="friend"  @click="setFlag">
                    <div>好友通知</div>
                    <div><el-icon>
                            <ArrowRight />
                        </el-icon></div>
                </div>
                <div class="friends" @click="changeFlag">
                    <div >群通知</div>
                    <div><el-icon>
                            <ArrowRight />
                        </el-icon></div>
                </div>
            </div>
            <el-tabs stretch @tab-change="changeTab">
                <el-tab-pane label="好友">
                </el-tab-pane>
                <el-tab-pane label="群聊">
                </el-tab-pane>
            </el-tabs>
            <div class="bg">
                <img :src="pubUse.getAssetsFile('no_contact.png')">
            </div>
            <div class="icon">
                <el-icon>
                    <Search />
                </el-icon>
            </div>
            <div class="add">
                <img :src="pubUse.getAssetsFile('添加好友.png')">
            </div>

        </div>
        <div class="ct">
            <FriendView v-if="!flag"></FriendView>
            <FriendsView v-if="flag"></FriendsView>
        </div>
    </div>
</template>

<script setup lang="ts">
import pubUse from '../../../utils/pubUse';
import type { TabsPaneContext } from 'element-plus'
import { ref } from 'vue'
import FriendView from '../message/friend/FriendView.vue';
import FriendsView from '../message/friend/FriendsView.vue';


const changeTab = (tab: TabsPaneContext, event: Event) => {
    console.log(tab, event)
}
const flag = ref<boolean>(false)
const setFlag = ()=>{
    flag.value = false
}
const changeFlag = ()=>{
    flag.value = true
}

</script>

<style scoped lang="scss">
.message {
    width: 20vw;
    height: 100vh;
    background-color: #fbfbfb;
    padding-top: 1px;
    position: relative;

    .search {
        margin-top: 15px;
        background-color: #f4f4f4;
        width: 12vw;
        height: 30px;
        margin-left: 2.5vw;
        border-radius: 12px;
        overflow: hidden;

        input {
            background-color: transparent;
            outline: none;
            border: none;
            text-indent: 2rem;
            line-height: 30px;
            font-size: 12px;
        }
    }

    .bg {
        width: 100%;
        margin-top: 10vh;

        img {
            width: 100%;
        }
    }

    .list {
        border-bottom: 2px solid rgba(17, 27, 37, 0.2);

        .friend,
        .friends {
            padding: 10px;
            display: flex;
            justify-content: space-between;
            cursor: pointer;

        }
    }

    .tab {
        width: 100%;
    }

    .icon {
        position: absolute;
        left: 35px;
        top: 25px;
    }

    .add {
        position: absolute;
        right: 10px;
        top: 18px;
        width: 30px;

        img {
            width: 100%;
        }
    }
}

.ct {
    width: 70vw;
    height: 100vh;
    background-color: #f2f2f2;


}

.box {
    width: 90vw;
    height: 100vh;
    display: flex;
}
</style>